package com.bw.home.service

import com.bw.home.api.LoginApi
import com.bw.home.entity.LoginEntity
import com.bw.lib_net.BaseRes
import com.bw.lib_net.RetrofitFactory

class LoginService {
    private val api: LoginApi

    init {
        api = RetrofitFactory.getRetrofit().create(LoginApi::class.java)
    }

    suspend fun login(username: String, password: String): BaseRes<LoginEntity> {
        return api.login(username, password)
    }


    suspend fun register(username: String, password: String): BaseRes<LoginEntity> {
        return api.register(username, password)
    }
}